using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using BasicForms;

namespace Portal
{
    public partial class FrmThongTinCoSoThuoc : FrmOKCancel
    {
        public FrmThongTinCoSoThuoc()
        {
            InitializeComponent();
        }

        private void FrmThongTinCoSoThuoc_Load(object sender, EventArgs e)
        {
            if (DesignMode) return;
            txtTenCoSo.Text = GeneralLibs.Config.TenDoanhNghiep;  
            txtChuCoSo.Text = GeneralLibs.Config.ChuCoSo;  
            txtSoChungChi.Text = GeneralLibs.Config.SoChungChi;  
            dateNgayCap.EditValue = GeneralLibs.Config.NgayCapChungChi;  
            txtDienThoai.Text = GeneralLibs.Config.DienThoai;  
            txtEmail.Text = GeneralLibs.Config.Email;  
            txtDiaChi.Text = GeneralLibs.Config.DiaChi;  
            txtPhamViHoatDong.Text = GeneralLibs.Config.PhamViHoatDong;
        }

        protected override void btnOK_Click(object sender, EventArgs e)
        {
            GeneralLibs.Config.TenDoanhNghiep = txtTenCoSo.Text.Trim();
            GeneralLibs.Config.ChuCoSo = txtChuCoSo.Text.Trim();
            GeneralLibs.Config.SoChungChi = txtSoChungChi.Text.Trim();
            if (dateNgayCap.EditValue is DateTime)
                GeneralLibs.Config.NgayCapChungChi = (DateTime)dateNgayCap.EditValue;
            else
                GeneralLibs.Config.NgayCapChungChi = null;
            GeneralLibs.Config.DienThoai = txtDienThoai.Text.Trim();
            GeneralLibs.Config.Email = txtEmail.Text.Trim();
            GeneralLibs.Config.DiaChi = txtDiaChi.Text.Trim();
            GeneralLibs.Config.PhamViHoatDong = txtPhamViHoatDong.Text.Trim();
            Close();
        }
    }
}

